<?
$user = $this->user;
$answers = $this->answers;
?>

<? if (isset($user)): ?>
<script>
    $(function(){


          $('.defaulttable thead td:nth-child(1)').css('width','105px');
          $('.defaulttable thead td:nth-child(2)').css('width','100px');
          $('.defaulttable thead td:nth-child(3)').css('width','150px');
          $('.defaulttable thead td:nth-child(4)').css('width','250px');
          $('.main_table games').addClass('next');




            $('.defaulttable tbody tr:odd').addClass('odd');

    });
</script>
<img class="img_user" src="<?=$user['avatar']?>" alt="">
    <table class="main_table">
    <thead>
    <tr>
        <td colspan="2">
            <b style="color: orange;">Info about User</b>
        </td>
    </tr>
    </thead>
    <tbody>
    <tr class="next">
        <td>Nick</td>
        <td><?= $user['nick'] ?></td>
    </tr>
    <tr>
        <td>Name</td>
        <td><?= $user['name'] ?><br> <?= $user['lastName'] ?></td>
    </tr>
    <tr class="next">
        <td>Gender</td>
        <td>
        <?if($user['gender']['name']=='Male'):?>
        <?$imgsrc='male.png';?>
        <?else: $imgsrc='female.png';  ?>
        <?endif;?>
            <img src="/pictures/<?=$imgsrc?>" style="width: 26px;">
        </td>
    </tr>
    <tr>
        <td>Birsday</td>
        <td><?=$user['birthday']->format('Y-m-d')?></td>
    </tr>
    <tr class="next">
        <td>Region</td>
        <td><?= $this->coords ?></td>
    </tr>
    </tbody>
</table>
    <div style="clear: both;"></div>


    <table class="main_table games">
    <thead>
    <tr>
        <td>#</td>
        <td>IMG</td>
        <td>Title</td>
        <td>Correct answer</td>
        <td>Answer</td>
    </tr>
    </thead>

    <tbody>
    <?foreach ($answers as $key=>$answer): ?>
<!--     --><?//print_r($answer['map']); die;?>
    <tr class="next">
            <td>1</td>
            <td><img src="<?=$answer['map']['url']?>" alt=""></td>
            <td><?=$answer['map']['title']?></td>
            <td><?=$correct = $answer['isCorrect'] ? 'yes' : 'no'?></td>
            <td><a href="/report/view/id/<?=$answer['map']['id']?>">View answers</td>
        </tr>
    <?endforeach;?>
    </tbody>
</table>


<? else: ?>
User does not exist.
<? endif; ?>


